#pragma once
#include "xFrameBase.h"
#include "xnamath.h"
struct ConeVertex
{
	XMFLOAT3 Pos;
	XMFLOAT2 Texture;
};

class xCone : public xFrameBase
{
public:
	xCone();
	~xCone();
	XDECLARE_MESSAGE_MAP();
public:
	static xFrameBase *CreateObject();
private:
	xEffect				*m_pEffect;
	xTechnique			*m_pTechnique;
	xInputLayout		*m_pLayout;
	XINPUT_ELEMENT_DESC	*m_pLayoutDesc;
	xBuffer				*m_pVertexBuffer;
	XMMATRIX			m_World;
	XMMATRIX			m_View;
	XMMATRIX			m_Projection;
	XMFLOAT3			m_fAngle;
	XMFLOAT3			m_fOffset;
	XMFLOAT3			m_fScaling;
	BOOL				m_down;
	POINT				m_ponit;
	FLOAT				m_fRate;
	FLOAT				m_fR;
	xButton				m_btnTexture,
						m_btnMesh;
	int					m_nVertexCount;
	D3D11_PRIMITIVE_TOPOLOGY Topology;
protected:
	virtual void OnDraw();
	virtual void OnLButtonDown(UINT nFlags, POINT point);
	virtual void OnLButtonUp(UINT nFlags, POINT point);
	virtual void OnMouseMove(UINT nFlags, POINT point);
	virtual void OnMouseLeave();
	virtual void OnMouseWheel(UINT nFlags, short zDelta, POINT point);
protected:
	void OnBtnFullscreen(xControl &sender);
	void OnBtnTexture(xControl &sender);
	void OnBtnMesh(xControl &sender);
protected:
	BOOL OnCreate(CREATESTRUCT *pCreate);
	BOOL Reset(UINT nSampleCount);
	void re();
	void PrepareLayout();
	void InitVertex();
};